<?php

namespace App\Model;

use Illuminate\Database\Eloquent\Model;

class Feedback extends Model
{
    //
    protected $table = "feedback";
    public $timestamps = false;

    /**
     * 获取所有反馈信息并分页
     * @return mixed
     */
    public static function getFeedbackInfo()
    {
        $res = self::orderBy('rank','DESC')->orderBy('update_time','DESC')->paginate(10);
        return $res;
    }
    /**
     * 获取对应分类反馈信息并分页
     * @return mixed
     */
    public static function getCategory($id)
    {
        $res = self::where('category',$id)->orderBy('rank','DESC')->orderBy('update_time','DESC')->paginate(10);
        return $res;
    }

    public static function deleteFeedback($id)
    {
        $res = self::where('id',$id)->delete();
        return $res;
    }
}
